﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Masters/Basic.Master" AutoEventWireup="true" CodeBehind="InvoiceToAsk.aspx.cs" Inherits="PMS.UI.FM.InvoiceToAsk" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script type="text/javascript">
        $(function () {
            var height = $("#divTotal").height();
            var master = $("#master").height();
            var content = parseFloat(height) - parseFloat(master) - 30;
            $("#tbList").css("height", content)
        });
    </script>

    <script type="text/javascript">
        $(function () {
            $("#tbList").datagrid({
                url: '/Logic/FM/InvoicePayAjax.aspx?method=GetInvoiceToAskList',
                loadMsg: '数据加载中请稍后……',
                //fitColumns: true,
                pagination: true,
                rownumbers: true,
                idField: "ID",
                singleSelect: true,
                pageSize: 10,
                pageList: [10, 20, 30],
                frozenColumns: [[
                    {
                        field: 'ck', checkbox: true, width: 30
                    },
                    {
                        field: 'InvoiceNo', title: '发票编号', sortable: true, align: "left", width: 120
                    },
                    {
                        field: 'InvoiceName', title: '名称', sortable: false, align: 'left', width: 120
                    },
                    {
                        field: 'Money', title: '发票金额', sortable: true, align: 'center', width: 60
                    },
                    {
                        field: 'State', title: '状态', align: "center", width: 60, formatter: function (value, row, index) {
                            return com.getArrayText(StaticCombo.InvoiceState, value)
                        },
                        styler: function (value, row, index) {
                            time = row.Date;
                            if (time != "" & time != null) {
                                var len = Math.abs((new Date() - Date.parse(new Date(time))) / 1000 / 3600 / 24);
                                if (len > 30 && row.State == 0) {
                                    return "color:red"
                                }
                            }
                        }
                    },
                    {
                        field: 'Date', title: '开票日期', sortable: true, align: 'center', width: 120
                    }
                ]],
                columns: [[
                    {
                        field: 'ComName', title: '客户名称', sortable: false, align: 'left', width: 120
                    },
                    {
                        field: 'Code', title: '合同编号', sortable: false, align: 'left', width: 120
                    },
                    {
                        field: 'ContractName', title: '合同名称', sortable: false, align: 'left', width: 120
                    },
                    {
                        field: 'TaxpayerID', title: '纳税人识别号', sortable: false, align: 'center', width: 120
                    },
                    {
                        field: 'Bank', title: '开户银行', sortable: false, align: 'center', width: 120
                    },
                    {
                        field: 'BankAccount', title: '银行账号', sortable: false, align: 'center', width: 120
                    },
                    {
                        field: 'Note', title: '备注', align: "center", width: 200
                    }
                ]],
                singleSelect: true,
                pageSize: 20,
                pageList: [20, 50, 100],
                striped: true
            })
        })
    </script>

    <script type="text/javascript">
        function funcAdd() {
            var row = $("#tbList").datagrid('getSelected')
            if (row) {
                top.wrapper.addTab('查看发票回款信息', '/UI/FM/InvoicePayInfo.aspx?method=look&Id=' + row.ID)
            } else {
                com.message('information', '请选择一行进行查看')
            }
        }

        function funcEdit() {
            var row = $('#tbList').datagrid('getSelected');
            if (row) {
                if (row.State == "0" || row.State == "1") {
                    top.wrapper.addTab('编辑发票回款信息', "/UI/FM/InvoicePayInfo.aspx?method=edit&Id=" + row.ID)
                } else {
                    com.message("information", "当前状态发票回款信息无法编辑")
                }
            }
            else {
                com.message("information", "请选中一行")
            }
        }

        //查询
        function funcSearch() {
            var para = com.serializeSearchArray("form1");
            $("#tbList").datagrid("load", para)
        }

        //重置
        function funcReload() {
            $("#form1").form("reset");
            var para = com.serializeSearchArray("form1");
            $("#tbList").datagrid("load", para)
        }

    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div id="divTotal" style="height: 100%; width: 100%">
        <div id="master" class="container_12" style="height: auto; width: 100%">
            <form id="form1">
                <div class="grid_1 sealbl" style="text-align: right; width: 100px">
                    发票编号 :
                </div>
                <div class="grid_2 seaval" style="text-align: left;">
                    <input type="text" id="InvoiceNo" name="InvoiceNo" data-cp="co" />
                </div>
                <div class="grid_1 sealbl" style="text-align: right;">
                    发票名称 :
                </div>
                <div class="grid_2 seaval" style="text-align: left;">
                    <input type="text" id="InvoiceName" name="InvoiceName" data-cp="co" />
                </div>
                <div class="grid_1 sealbl" style="text-align: right; width: 100px">
                    合同编号 :
                </div>
                <div class="grid_2 seaval" style="text-align: left;">
                    <input type="text" id="Code" name="Code" data-cp="co" />
                </div>
                <div class="grid_1 sealbl" style="text-align: right;">
                    合同名称 :
                </div>
                <div class="grid_2 seaval" style="text-align: left;">
                    <input type="text" id="ContractName" name="ContractName" data-cp="co" />
                </div>
                <div class="Clear"></div>
                <div class="grid_1 sealbl" style="text-align: right; width: 100px">
                    客户名称 :
                </div>
                <div class="grid_2 seaval" style="text-align: left;">
                    <input type="text" id="ComName" name="ComName" data-cp="co" />
                </div>
                <div class="grid_1 sealbl" style="text-align: right;">
                    发票状态 :
                </div>
                <div class="grid_2 seaval" style="text-align: left;">
                    <input type="text" class="easyui-combobox" id="State" name="State" data-cp="=" data-options="valueField:'value',textField:'text',data:StaticCombo.InvoiceState,value:'0',panelHeight:'auto'" />
                </div>
                <div class="grid_1 sealbl" style="width: 100px; text-align: right">
                    开票时间从年月:
                </div>
                <div class="grid_2 seaval" style="text-align: left;">
                    <input type="text" id="startSignDate" name="startSignDate" data-cp="str>=" class="easyui-datebox" />
                </div>
                <div class="grid_1 sealbl" style="text-align: right; width: 54px">
                    到年月:
                </div>
                <div class="grid_2 seaval" style="text-align: left;">
                    <input type="text" id="endSignDate" name="endSignDate" data-cp="str<=" class="easyui-datebox" />
                </div>
            </form>
        </div>
        <div class="Clear"></div>
        <div style="height: 94%">
            <table id="tbList" title="发票信息表 " data-options="fit:true"></table>
        </div>
    </div>
</asp:Content>
